package com.esint.validation.entity.car;

import com.esint.validation.validators.EngineModuleTypeRule;
import lombok.AllArgsConstructor;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @description: 汽车引擎类
 * @author: 谷明
 * @createDate: 2021/8/12 17:59
 */
@Data
@AllArgsConstructor
public class Engine {
    /**
     * 发动机序列号
     */
    @NotBlank
    private String serNo;
    /**
     * 发动机型号
     */
    @NotBlank
    @EngineModuleTypeRule(message = "发动机型号描述不对")
    private String moduleType;
    /**
     * 最大马力
     */
    @NotNull
    @Range(min = 100, max = 2000, message = "马力只能在100~2000范围内")
    private Integer maxHoursePower;
}
